package cn.tedu.charging.device.dao.repository.impl;

import cn.tedu.charging.device.dao.mapper.StationMapper;
import cn.tedu.charging.device.dao.repository.StationRepository;
import cn.tedu.charging.device.pojo.po.StationPO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.util.CollectionUtils;

import java.util.Collections;
import java.util.List;

@Slf4j
@Repository
public class StationRepositoryImpl implements StationRepository {
    @Autowired
    private StationMapper stationMapper;

    @Override
    public List<StationPO> getAllStation() {
        List<StationPO> stationPOS = stationMapper.selectList(null);
        if(!CollectionUtils.isEmpty(stationPOS)){
            return stationPOS;
        }
        return Collections.emptyList();
    }
}
